package com.kma.summer2012.model;
// Generated Dec 6, 2012 12:14:41 AM by Hibernate Tools 3.2.1.GA


import com.kma.summer2012.facade.DateAdapter;

import javax.persistence.*;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;

/**
 * CrumbsDateAndTime generated by hbm2java
 */
@XmlRootElement(name = "requestedDateAndTime")
@XmlAccessorType(XmlAccessType.FIELD)
@Entity
@Table(name = "CRUMBS_DATE_AND_TIME"
        , schema = "KMA1"
)
public class CrumbsDateAndTime implements java.io.Serializable {


    private int id;
    private CrumbsRequest crumbsRequest;

    @XmlElement(name = "dateBegin")
    @XmlJavaTypeAdapter(DateAdapter.class)
    private Date dateBegin;

    @XmlElement(name = "dateEnd")
    @XmlJavaTypeAdapter(DateAdapter.class)
    private Date dateEnd;

    private Date assignedTimeBegin;
    private Date assignedTimeEnd;

    public CrumbsDateAndTime() {
    }


    public CrumbsDateAndTime(int id, CrumbsRequest crumbsRequest, Date dateBegin, Date dateEnd) {
        this.id = id;
        this.crumbsRequest = crumbsRequest;
        this.dateBegin = dateBegin;
        this.dateEnd = dateEnd;
    }

    public CrumbsDateAndTime(int id, CrumbsRequest crumbsRequest, Date dateBegin, Date dateEnd, Date assignedTimeBegin, Date assignedTimeEnd) {
        this.id = id;
        this.crumbsRequest = crumbsRequest;
        this.dateBegin = dateBegin;
        this.dateEnd = dateEnd;
        this.assignedTimeBegin = assignedTimeBegin;
        this.assignedTimeEnd = assignedTimeEnd;
    }

    @Id
    @SequenceGenerator(name = "Date_time_seq", sequenceName = "DATE_AND_TIME_SEQ", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "Date_time_seq")

    @Column(name = "ID", unique = true, nullable = false, precision = 9, scale = 0)
    public int getId() {
        return this.id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "REQUEST_ID", nullable = false)
    public CrumbsRequest getCrumbsRequest() {
        return this.crumbsRequest;
    }

    public void setCrumbsRequest(CrumbsRequest crumbsRequest) {
        this.crumbsRequest = crumbsRequest;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "DATE_BEGIN", nullable = false, length = 7)
    public Date getDateBegin() {
        return this.dateBegin;
    }

    public void setDateBegin(Date dateBegin) {
        this.dateBegin = dateBegin;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "DATE_END", nullable = false, length = 7)
    public Date getDateEnd() {
        return this.dateEnd;
    }

    public void setDateEnd(Date dateEnd) {
        this.dateEnd = dateEnd;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "ASSIGNED_TIME_BEGIN", length = 7)
    public Date getAssignedTimeBegin() {
        return this.assignedTimeBegin;
    }

    public void setAssignedTimeBegin(Date assignedTimeBegin) {
        this.assignedTimeBegin = assignedTimeBegin;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "ASSIGNED_TIME_END", length = 7)
    public Date getAssignedTimeEnd() {
        return this.assignedTimeEnd;
    }

    public void setAssignedTimeEnd(Date assignedTimeEnd) {
        this.assignedTimeEnd = assignedTimeEnd;
    }


}


